﻿import { AnyColumn } from 'element-plus/es/components/table-v2/src/common';
import request from '/@/utils/request';
enum Api {
  AddKaosheng = '/api/kaosheng/add',
  DeleteKaosheng = '/api/kaosheng/delete',
  UpdateKaosheng = '/api/kaosheng/update',
  PageKaosheng = '/api/kaosheng/page',
  DetailKaosheng = '/api/kaosheng/detail',
  GetKaoshiKaoshiIdDropdown = '/api/kaosheng/KaoshiKaoshiIdDropdown',
  GetBanjiBanjiIdDropdown = '/api/kaosheng/BanjiBanjiIdDropdown',
  GetJiaoxueBanJiaoxueBanIdDropdown = '/api/kaosheng/JiaoxueBanJiaoxueBanIdDropdown',
  GetStudentStudentIdDropdown = '/api/kaosheng/StudentStudentIdDropdown',
  ImportFromStudent = '/api/kaosheng/ImportFromStudent',
  BatchDelete = '/api/kaosheng/batchDelete',
  RandomKaohao = '/api/kaosheng/randomKaohao',
  SetShichangNumZuoweihao = '/api/kaosheng/setShichangNumZuoweihao',
  SetZhunkaozhenghao = '/api/kaosheng/setZhunkaozhenghao',
  ExportKaosheng = '/api/kaosheng/export',
  ExportForXiwo = '/api/kaosheng/exportForXiwo',
  ImportKaosheng = '/api/kaosheng/import',
  ClearKaozheng = '/api/kaosheng/clear',
  
}

// 增加考生
export const addKaosheng = (params?: any) =>
	request({
		url: Api.AddKaosheng,
		method: 'post',
		data: params,
	});

// 删除考生
export const deleteKaosheng = (params?: any) => 
	request({
			url: Api.DeleteKaosheng,
			method: 'post',
			data: params,
		});

// 编辑考生
export const updateKaosheng = (params?: any) => 
	request({
			url: Api.UpdateKaosheng,
			method: 'post',
			data: params,
		});

// 分页查询考生
export const pageKaosheng = (params?: any) => 
	request({
			url: Api.PageKaosheng,
			method: 'post',
			data: params,
		});

// 详情考生
export const detailKaosheng = (id: any) => 
	request({
			url: Api.DetailKaosheng,
			method: 'get',
			data: { id },
		});

export const getKaoshiKaoshiIdDropdown = () =>
		request({
		url: Api.GetKaoshiKaoshiIdDropdown,
		method: 'get'
		});
export const getBanjiBanjiIdDropdown = () =>
		request({
		url: Api.GetBanjiBanjiIdDropdown,
		method: 'get'
		});
export const getJiaoxueBanJiaoxueBanIdDropdown = () =>
			request({
			url: Api.GetJiaoxueBanJiaoxueBanIdDropdown,
			method: 'get'
			});
		
export const getStudentStudentIdDropdown = () =>
		request({
		url: Api.GetStudentStudentIdDropdown,
		method: 'get'
		});

export const importFromStudent = (params?: any) =>
	request({
		url: Api.ImportFromStudent,
		method: 'post',
		data: params,
	});

export const batchDelete = (params?: any) =>
	request({
		url: Api.BatchDelete,
		method: 'post',
		data: params,
	});

export const randomKaohao = (params?: any) =>
	request({
		url: Api.RandomKaohao,
		method: 'post',
		data: params,
	});
	
export const setShichangNumZuoweihao = (params?: any) =>
	request({
		url: Api.SetShichangNumZuoweihao,
		method: 'post',
		data: params,
	});

export const setZhunkaozhenghao = (params?: any) =>
	request({
		url: Api.SetZhunkaozhenghao,
		method: 'post',
		data: params,
	});

export const exportKaosheng = (params?: AnyColumn) =>
	request({
		url: Api.ExportKaosheng,
		method: 'post',
		data: params,
		responseType: "blob"
	});

export const exportKaoshengForXiwo = (params?: any) =>
	request({
		url: Api.ExportForXiwo,
		method: 'post',
		data: params,
		responseType: "blob"
	});

export const importKaosheng = (kaoshiId: Long,fileId: Long) => 
	request({
			url: Api.ImportKaosheng,
			method: 'post',
			data: {kaoshiId:kaoshiId, fileId:fileId },
		});
	
export const clearKaozheng = (params?: any) =>
		request({
			url: Api.ClearKaozheng,
			method: 'post',
			data: params,
		});